package domain

import "net/http"

type Profile struct {
	UserID      string `json:"id" validate:"uuid4" gorm:"primaryKey"`
	Username    string `json:"username" validate:"omitempty,required"`
	Phone       string `json:"phone" validate:"omitempty,startswith=1,len=11"`
	Email       string `json:"email" validate:"email"`
	PersonalWeb string `json:"personal_web" validate:"omitempty,url"`
	Company     string `json:"company" validate:"omitempty,lte=32"`
	Job         string `json:"job" validate:"omitempty,lte=32"`
	Location    string `json:"location" validate:"omitempty,lte=32"`
	Signature   string `json:"signature" validate:"omitempty,lte=32"`
	Introduce   string `json:"introduce" validate:"omitempty,lte=100"`
}

type ProfileHandler interface {
	GetProfileSettings(w http.ResponseWriter, r *http.Request)
	GetProfileSettingsByName(w http.ResponseWriter, r *http.Request)
	UpdateProfileSettings(w http.ResponseWriter, r *http.Request)
}

type ProfileService interface {
	CheckProfile(profile Profile) error
	UpdateProfile(profile *Profile) error
	GetProfileByUserID(userId string) (*Profile, error)
	GetProfileByName(username string) (*Profile, error)
	GetUserByID(userID string) (*User, error)
}

type ProfileReposiroty interface {
	SaveProfile(profile *Profile) error
	GetProfileByUserID(userID string) (*Profile, error)
	GetProfileByName(username string) (*Profile, error)
	GetUserByID(userID string) (*User, error)
}
